package entitiesIds;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * UserteamId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class UserteamId implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 7689226026612485205L;
	private Integer idTeam;
	private Integer idUser;

	// Constructors

	/** default constructor */
	public UserteamId() {
	}

	/** full constructor */
	public UserteamId(Integer idTeam, Integer idUser) {
		this.idTeam = idTeam;
		this.idUser = idUser;
	}

	// Property accessors

	@Column(name = "idTeam", nullable = false)
	public Integer getIdTeam() {
		return this.idTeam;
	}

	public void setIdTeam(Integer idTeam) {
		this.idTeam = idTeam;
	}

	@Column(name = "idUser", nullable = false)
	public Integer getIdUser() {
		return this.idUser;
	}

	public void setIdUser(Integer idUser) {
		this.idUser = idUser;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof UserteamId))
			return false;
		UserteamId castOther = (UserteamId) other;

		return ((this.getIdTeam() == castOther.getIdTeam()) || (this
				.getIdTeam() != null && castOther.getIdTeam() != null && this
				.getIdTeam().equals(castOther.getIdTeam())))
				&& ((this.getIdUser() == castOther.getIdUser()) || (this
						.getIdUser() != null && castOther.getIdUser() != null && this
						.getIdUser().equals(castOther.getIdUser())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getIdTeam() == null ? 0 : this.getIdTeam().hashCode());
		result = 37 * result
				+ (getIdUser() == null ? 0 : this.getIdUser().hashCode());
		return result;
	}
	
	@Override
	public String toString() {
		return "UserteamId [idTeam=" + idTeam + ", idUser=" + idUser + "]";
	}
}